package com.ccn.shardingjdbc.mapper;

import com.ccn.shardingjdbc.entity.Cars;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author wangxy
 * @date 2021/7/5 9:12
 */
@Repository
public interface CarsMapper {

   @Insert("insert into cars(id,name,color,size) values(#{id},#{name},#{color},#{size})")
    int saveCar(Cars cars);
    @Select("select * from cars")
    List<Cars> listCars();
}
